﻿
function doSearchA()
 {
      var item_180 = document.getElementById("item_180").value;

      var workspeciality = document.getElementById("WorkSpeciality").value;

      var item_185 = document.getElementById("item_185").value;
      var workspeciality = document.getElementById("WorkSpeciality").value;
      
      var achievement = document.getElementById("Achievement").value;
      

      var province=document.getElementById("province").options[document.getElementById("province").options.selectedIndex].value;
      var province_c=document.getElementById("province").options[document.getElementById("province").options.selectedIndex].text;
     
      var item_182=document.getElementById("item_182").options[document.getElementById("item_182").options.selectedIndex].value;  
      var item_182_c=document.getElementById("item_182").options[document.getElementById("item_182").options.selectedIndex].text;  

     
      var item_184=document.getElementById("item_184").options[document.getElementById("item_184").options.selectedIndex].value;  
      var item_184_c=document.getElementById("item_184").options[document.getElementById("item_184").options.selectedIndex].text;  
       
      //var newenergyclass = document.all.NewEnergyClass.options[document.all.NewEnergyClass.selectedIndex].value;
      //var newenergyclass_c = document.all.NewEnergyClass.options[document.all.NewEnergyClass.selectedIndex].text;    

	//&& newenergyclass=="" 
    if( item_180 == "" &&  workspeciality == "" && achievement == "" && item_185 == ""  && province =="" &&  item_182 =="" && item_184=="" )
    {
        alert("请选择检索字段，谢谢！");
        return;
    }

    document.getElementById("topicname").value = "";
    var v_condition = " 1=1 ";
     //姓名           
    if  (item_180!="")
    {
    	v_condition=v_condition + " and charindex('" + item_180 + "', Item_180)>0" ;
        document.getElementById("topicname").value = item_180;
    } 


     //从事专业          
    if  (workspeciality!="")
    {
    //	v_condition=v_condition+" and WorkSpeciality like '%" + workspeciality + "%'" ;
    	v_condition=v_condition+"  and charindex('" + workspeciality + "', WorkSpeciality)>0" ;
        if (document.getElementById("topicname").value == "") {
        document.getElementById("topicname").value = workspeciality;
        }
        else {
            document.getElementById("topicname").value = document.getElementById("topicname").value + "+"+workspeciality;
        }
    }
    
    //主要成就        
    if  (achievement!="")
    {
    //	v_condition=v_condition+" and WorkSpeciality like '%" + workspeciality + "%'" ;
    	v_condition=v_condition+"  and charindex('" + achievement + "', Achievement)>0" ;
        if (document.getElementById("topicname").value == "") {
        document.getElementById("topicname").value = achievement;
        }
        else {
            document.getElementById("topicname").value = document.getElementById("topicname").value + "+"+achievement;
        }
    } 
    
    

     //单位          
    if  (item_185!="")
    {
       	v_condition=v_condition + " and charindex('" + item_185 + "', Item_185)>0" ;
        if (document.getElementById("topicname").value == "") {
        document.getElementById("topicname").value = item_185;
        }
        else {
            document.getElementById("topicname").value = document.getElementById("topicname").value + "+" + item_185;
        }
    } 

   
      
     //地区             
    if (province!="")
    {
    	v_condition=v_condition+" and Item_dqdm='" + province + "'";

       if (document.getElementById("topicname").value == "") {
             document.getElementById("topicname").value = province_c;
        }
        else {
            document.getElementById("topicname").value = document.getElementById("topicname").value + "+" + province_c;
        }          

    }

    //文化程度          
    if (item_184!="")
    {   if (item_184 == "5") {
    	     v_condition=v_condition+" and Item_184>='" + item_184 + "'";
        }
        else {
             v_condition=v_condition+" and Item_184='" + item_184 + "'";
        }

        if (document.getElementById("topicname").value == "") {
             document.getElementById("topicname").value = item_184_c;
        }
        else {
            document.getElementById("topicname").value = document.getElementById("topicname").value + "+" + item_184_c;
        }  
    }


    //年龄
   if (item_182!="")
   {  if (item_182=="1") { 
          item_182="(cast(substring(convert(char(10),getdate(),102),1,4) as int ) - cast(substring(Item_182,1,4) as int)) >=25 and (cast(substring(convert(char(10),getdate(),102),1,4) as int ) - cast(substring(Item_182,1,4) as int)) <=45";
        }
         if (item_182=="2"){ 
          item_182="(cast(substring(convert(char(10),getdate(),102),1,4) as int ) - cast(substring(Item_182,1,4) as int)) >=46 and (cast(substring(convert(char(10),getdate(),102),1,4) as int ) - cast(substring(Item_182,1,4) as int)) <=60";
         }
         if (item_182=="3") { 
          item_182="(cast(substring(convert(char(10),getdate(),102),1,4) as int ) - cast(substring(Item_182,1,4) as int)) >60 ";
         }  
       
     	v_condition=v_condition+ " and " + item_182;

          if (document.getElementById("topicname").value == "") {

               document.getElementById("topicname").value = item_182_c;
               
          }
          else {
              document.getElementById("topicname").value = document.getElementById("topicname").value + "+" + item_182_c;
          }  
      }
      
     //暂时屏了专家类别
    //专家类别
    /*if (newenergyclass!="")
    {
    	v_condition=v_condition+" and (NewEnergyClass1='" + newenergyclass + "' or NewEnergyClass2='" + newenergyclass + "')";
        if (document.all.topicname.value == "") {
                        document.all.topicname.value = newenergyclass_c;
        }
        else {
                        document.all.topicname.value = document.all.topicname.value + "+" + newenergyclass_c;
        }
    }*/
    document.getElementById("key").value=v_condition;  
    
    document.getElementById("searchform").submit();
   
}


function doSearch()
{      var con_item_180 = document.getElementById("item_180").value;
       
       if (con_item_180 == "" )
      {
        alert("请选择检索词，谢谢！");
        return;
       }
     
      var v_condition = " 1=1 ";
      var v_condition1 = "";
      var v_condition2 = ""; 
      var v_condition3 = ""; 
      document.getElementById("topicname").value = con_item_180;  
   
      
    if  (con_item_180!="")
    { //姓名
    	v_condition1 =  " charindex('" + con_item_180 + "', Item_180)>0" ;
       
      //从事专业
        v_condition2 =  " charindex('" + con_item_180 + "', WorkSpeciality)>0" ;

      //单位
        v_condition3 =  " charindex('" + con_item_180 + "', Item_185)>0" ;
        
      //介绍
        v_condition4 =  " charindex('" + con_item_180 + "', ExpIntro)>0" ;
        

       v_condition =  v_condition1 + " or " + v_condition2 + " or " + v_condition3 +" or " + v_condition4; 
       document.getElementById("key").value=v_condition;
       document.getElementById("searchform").submit(); 
    }
   
}

